<div class="modal" id="assign_modal" tabindex="-1" role="dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <div class="modal-title">版主节点分配</div>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="index-sections card">
          <div class="card-body">
            <div class="row node-list">
              <% Section.includes(:nodes).all.each do |section| %>
              <div class="node media">
                <label class="mr-2 media-left"><%= section.name %></label>
                <span class="nodes media-body">
                  <% section.nodes.sorted.each do |node| %>
                    <span class="name">
                      <%= link_to(node.name, node_topics_path(node), title: node.name, data: { id: node.id }, class: @user.node_assignment_ids.include?(node.id) ? 'active' : '')%>
                    </span>
                  <% end %>
                </span>
              </div>
              <% end %>
            </div>
          </div>

          <div class="card-footer">
            <div class="float-right">
              <a href="#" data-id="<%= @user.id %>" data-disable-with="处理中..." class="btn btn-sm btn-primary" remote="true">确定</a>
              <button data-dismiss="modal" class="btn btn-sm btn-default">取消</button>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
</div>
